// 配置
import Mock from 'mockjs'
import { deal } from "../utils/globalUtil";
import { routes } from "../router";

// 菜单请求
Mock.mock(RegExp('/getMenu.*'), 'get', (option) => {
  let param = deal.getUrlParam(option.url);
  if (param.role === 'admin') {
    return {
      success: true,
      msg: '',
      data: routes[0].children
    }
  } else {
    return {
      success: false,
      code: 'login_fail_1',
      msg: '获取失败，权限不够',
      data: {}
    }
  }
});
